package net.digitalprimates.flex2.uint.utils
{
  import mx.core.UIComponent;
  import mx.rpc.http.HTTPService;
  
  public class LoggerUtils
  {
    public function LoggerUtils()
    {
    }
    
    /**
     * Displays a friendly, concise name that is useful for logging.
     */
    public static function friendlyName(object:Object) : String
    {
      if (object is UIComponent)
      {
        return (object as UIComponent).id;
      }
      else if (object is HTTPService)
      {
        return (object as HTTPService).url;
      }
      else
      {
        return object.toString();
      }
    }

  }
}